package fun.yyds.common;

import java.lang.management.ManagementFactory;

/**
 * URL
 */
public enum Constant {

    RUNNING_GET_MP_TIME_RANG(getUrl("running/mp/rang")),
    BILL_START_PROCESS_INSTANCE(getUrl("process/bill/start")),
    RUNNING_GET_MP_LASTROW_BY_TMS(getUrl("running/mp/lastRow")),
    NOTICE_QW_BILL_ERROR(getUrl("ms/common/notice")),
    NOTICE_POST_SEND_MAIL(getUrl("ms/mail"));

    private final String url;

    Constant(String url) {
        this.url = url;
    }

    public String getUrl() {
        return url;
    }

    private static String getUrl(String path) {
        String name = ManagementFactory.getOperatingSystemMXBean().getName().toLowerCase();
        String baseUrl = name.contains("windows") ? "http://localhost:9996" : "http://chensn.default:9996";
        return baseUrl + "/admin/" + path;
    }
}